<!DOCTYPE html>
<html lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>${_title}</title>

    <!-- Bootstrap core CSS -->

    <link href="${_css}/bootstrap.min.css" rel="stylesheet">

    <link href="${_font}/css/font-awesome.min.css" rel="stylesheet">
    <link href="${_css}/animate.min.css" rel="stylesheet">

    <!-- Custom styling plus plugins -->
    <link href="${_css}/custom.css" rel="stylesheet">
    <link href="${_css}/icheck/flat/green.css" rel="stylesheet">
    <link href="${_css}/custom.css" rel="stylesheet">
    <link href="${_css}/icheck/flat/green.css" rel="stylesheet">
    <link href="${_css}/datatables/tools/css/dataTables.tableTools.css" rel="stylesheet">
    <link rel="stylesheet" href="${_css}/base.css">
    <script src="${_js}/jquery.min.js"></script>
    <script type="text/javascript" src="${_front_js}/jquery.page.js"></script>
    <script src="${_js}/resize.js"></script>
    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
          <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
        <![endif]-->

</head>


<body style="background: #F7F7F7;">
<div class="">
        <div class="row">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                    <div class="x_title">
                        <h2>修改用户银行卡信息</h2>
                        <div class="clearfix"></div>
                    </div>
                    <div class="x_content">

                        <form class="form-horizontal form-label-left" novalidate>
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">用户名</label>
                                <div class="col-md-3 col-sm-3 col-xs-6">
                                	<input type="text" disabled="disabled" value="${item.userName!}" class="form-control col-md-7 col-xs-12">
                                </div>
                            </div>
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="password">真实姓名
                                </label>
                                <div class="col-md-3 col-sm-3 col-xs-6">
                                	<input type="text" readonly="readonly" value="${item.realName!}" class="form-control col-md-7 col-xs-12">
                                </div>
                            </div>
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="re-password">手机号码
                                </label>
                                <div class="col-md-3 col-sm-3 col-xs-6">
                                   <input type="text" readonly="readonly" value="${item.phone!}" class="form-control col-md-7 col-xs-12">
                                </div>
                            </div>
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="re-password">证件号码
                                </label>
                                <div class="col-md-3 col-sm-3 col-xs-6">
                                   <input type="text" readonly="readonly" value="${item.certId}" class="form-control col-md-7 col-xs-12">
                                </div>
                            </div>      
                             <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="re-password">选择开户省份
                                </label>
                                <div class="col-md-3 col-sm-3 col-xs-6">
                                    <#if (cityList?exists && cityList?size>0) >
                                     <select  class="form-control" id="province"  data_action="/admin/userinfo/querylist">
                                      <option   value="-1">---请选择开户省份---</option>
                                      <#list cityList as provice>
                                         <#if provice.pid ==-1>
                                           <option   value=<#if provice.code?exists>${provice.code}</#if> data=<#if provice.id?exists>${provice.id}</#if> <#if (pid?exists && pid ==provice.id)>selected ="selected"<#elseif item.cityCode?exists && item.cityCode==provice.code>selected ="selected"</#if> >${provice.name}</option>
                                          </#if> 
                                       </#list>
                                      </select>
                                    </#if>
                                </div>
                            </div>    
                            
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="re-password">选择开户地区
                                </label>
                                <div class="col-md-3 col-sm-3 col-xs-6">
                                    <#if (cityList?exists && cityList?size>0) >
                                     <select  class="form-control" id="city"  data_action="/admin/userinfo/querylist">
                                      <option   value="-1">---请选择开户地区---</option>
                                      <#list cityList as city>
                                         <#if city.pid !=-1 && city.pid?? >
                                           <option   value=<#if city.code?exists>${city.code}</#if> data=<#if city.pid?exists>${city.pid}</#if>   <#if item.cityCode?exists && item.cityCode==city.code>selected ="selected" </#if>>${city.name}</option>
                                          </#if> 
                                       </#list>
                                      </select>
                                    </#if>
                                </div>
                            </div>  
                            
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="re-password">选择开户行名称
                                </label>
                                <div class="col-md-3 col-sm-3 col-xs-6">
                                    <#if (bankList?exists && bankList?size>0) >
                                     <select  class="form-control" id="bank" data_action="/admin/userinfo/querylist">
                                      <option   value="-1">---请选择开户银行---</option>
                                      <#list bankList as model>
                                           <option   value=<#if model.code?exists>${model.code}</#if>  <#if item.bankCode?exists && item.bankCode== model.code>selected ="selected" </#if> >${model.name}</option>
                                       </#list>
                                      </select>
                                    </#if>
                                </div>
                            </div>  
                            <div class="item form-group">
                                <label class="control-label col-md-3 col-sm-3 col-xs-12" for="re-password">银行卡号
                                </label>
                                 <div class="col-md-3 col-sm-3 col-xs-6">
                                   <input type="text"  id="cardNo" <#if item.cardNo?exists>value=${item.cardNo}</#if> class="form-control col-md-7 col-xs-12">
                                </div>
                            </div>    
                            <div class="ln_solid"></div>
                            <div class="form-group">
                                <div class="col-md-6 col-md-offset-3">
                                    <button type="button" onclick="javascript:history.go(-1)" class="btn btn-primary">返回前一页</button>
                                    <button type="button" onclick="javascript:void(0);" class="btn btn-success">修改信息</button>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
  <script src="${_js}/bootstrap.min.js"></script>

<!-- bootstrap progress js -->
<script src="${_js}/progressbar/bootstrap-progressbar.min.js" type="text/javascript"></script>
<script src="${_js}/nicescroll/jquery.nicescroll.min.js" type="text/javascript"></script>
<!-- icheck -->
<script src="${_js}/icheck/icheck.min.js" type="text/javascript"></script>
<script src="${_js}/custom.js" type="text/javascript"></script>

<!-- PNotify -->
<script src="${_js}/notify/pnotify.core.js" type="text/javascript"></script>
<script src="${_js}/notify/pnotify.buttons.js" type="text/javascript"></script>
<script src="${_js}/notify/pnotify.nonblock.js" type="text/javascript" ></script>

<!-- daterangepicker -->
<script type="text/javascript" src="${_js}/datepicker/moment.min2.js"></script>
<script type="text/javascript" src="${_js}/datepicker/daterangepicker.js"></script>
<script type="text/javascript" src="${_front_js}/date.js"></script>
<script type="text/javascript" src="${_front_js}/layer/layer.js"></script>
<script>
		//加载扩展模块
		layer.config({
		    extend: 'extend/layer.ext.js'
		});
		    $(document).ready(function () {
    	//var nowDate = new Date();
    	//var year = formatYearDate(nowDate);
    	//var month = formatMonthDate(nowDate);
    	//var day = formatDayDate(nowDate);
    	//$("#reservation").attr("value","12/01/2015 - "+month+"/"+day+"/"+year);
        $('#reservation').daterangepicker(null, function (start, end, label) {
            //console.log(start.toISOString(), end.toISOString(), label);
        });
    });
    
        $(document).ready(function(){
        $('input.tableflat').iCheck({
            checkboxClass: 'icheckbox_flat-green',
            radioClass: 'iradio_flat-green'
        });
    });
  <!--选择省份-->
  
  $("#province").change(function(){
  
    var  provinceId = $(this).find("option:selected").attr("data");
    var  value_ = $(this).find("option:selected").val();
    var action= $(this).attr("data_action");
       action+="?uid="+${item.uid};
       if(provinceId!="" && value_!="-1"){
          action+="&pid="+provinceId;
         }
    window.location.href=action;	
  });

 
 $(".btn-success").click(function(){
    	var province=$("#province").find("option:selected").val();
    	var cityCode=$("#city").find("option:selected").val();
    	var bankCode=$("#bank").find("option:selected").val();
    	var cardNo=$("#cardNo").val();
    	var uid= ${item.uid};
		if(province=='' || province=="-1"){
	        new PNotify({
            	title: '操作提示',
            	text:  '省份不能为空!',
            	delay: 3e3,
            	type:  'error'
        	});
        	return false;
		}
		
		if(cityCode==''|| cityCode=='-1'){
	        new PNotify({
            	title: '操作提示',
            	text:  '开户城市不能为空!',
            	delay: 3e3,
            	type:  'error'
        	});
        	return false;
		}
	   if(bankCode=='' || bankCode=='-1'){
	        new PNotify({
            	title: '操作提示',
            	text:  '开户行不能为空!',
            	delay: 3e3,
            	type:  'error'
        	});
        	return false;
		}
	  if(cardNo==''){
	        new PNotify({
            	title: '操作提示',
            	text:  '银行卡号不能为空!',
            	delay: 3e3,
            	type:  'error'
        	});
        	return false;
		}
		var info=JSON.stringify({
		     "uid":uid,
		  	 "cityCode":cityCode,
		  	 "bankCode":bankCode,
		   	 "cardNo":cardNo
		});
		$.ajax({
            type: 'POST',
            dataType: 'JSON',
            async:'false',
            headers: {'Content-type': 'application/json;charset=UTF-8'},
            data:info,
            url: '/admin/userinfo/modify',
            success: function(result){
              //console.log(result);
       		  if(result.code==-1){
       		        new PNotify({
		            	title: '操作提示',
		            	text: result.msg,
		            	delay: 3e3,
		            	type: 'success'
		        	}); 
		        	window.location.herf="/admin/userinfo/list?1=1";
       		  }else{
            		new PNotify({
		            	title: '操作提示',
		            	text: result.msg,
		            	delay: 3e3,
		            	type: 'error'
		        	});       		  	
       		  }
            }
	    })		
    });

</script>
</body>
</html>